home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Games Collection 1 / software vault.zip / software vault / CDR10 / SPX20.ZIP / SPX_DOC.ZIP / SPX_TXT.DOC < prev    next >
Text File  |  1993-09-14  |  2KB  |  75 lines

  1. { SPX Library Version 2.0  Copyright 1993 Scott D. Ramsay }
  2.  
  3.   SPX_TXT is the raster font handling unit.  It also allows you to
  4. display your own fonts.  Has a built in small text font. (Font used in
  5. GUI- of vspmaker and geomaker.)
  6.  
  7. ───────────────────────────────────────────────────────────────────────────
  8. function stlen(s:string):word;
  9.  
  10.    Returns the width of the string in pixels based on the current font.
  11.  
  12.    S: String to check
  13.  
  14. ───────────────────────────────────────────────────────────────────────────
  15. procedure putletter(x,y:integer;c:byte;s:string);
  16.  
  17.    Display a string on the active page.
  18.  
  19.    X,Y: Top-left position to place text;
  20.    C:   Color of text;
  21.    S:   String to display
  22.  
  23.    NOTE: IF (X) is negative then the text is centered on the screen
  24.  
  25. ───────────────────────────────────────────────────────────────────────────
  26. procedure drawletter(x,y:integer;c,c2:byte;s:string);
  27.  
  28.    Drawletter is the same as putletter with the following addition:
  29.  
  30.       putletter(x+1,y+1,c2,s);
  31.       putletter(x,y,c,s);
  32.  
  33.    This allows for shaded text.  Set the GUI's vspmaker and geomaker for
  34.   visual examples.
  35.  
  36.  
  37. ───────────────────────────────────────────────────────────────────────────
  38. procedure putchar(x,y:integer;h:char;c:byte);
  39.  
  40.    Display a character on the active page.
  41.  
  42.    X,Y: Top-left position to place character;
  43.    H:   Character to display;
  44.    C:   Color of character
  45.  
  46. ───────────────────────────────────────────────────────────────────────────
  47. procedure loadchb(fn:string;var cdata);
  48.  
  49.    Load a .CHB character font from disk.
  50.  
  51.    FN:     DOS file name of .CHB font file;
  52.    CDATA:  Character list to store the loaded font
  53.  
  54. ───────────────────────────────────────────────────────────────────────────
  55. procedure setchb(var buff);
  56.  
  57.   Sets the current loaded font.
  58.  
  59.   BUFF:  Buffer location of the new font
  60.  
  61.   EXAMPLE:
  62.  
  63.     var
  64.       myfont : CharList;
  65.               .
  66.               .
  67.               .
  68.  
  69.       Loadchb('myfont.chb',myfont);
  70.       setchb(myfont);
  71.  
  72.       putletter(0,0,15,'This is my font');
  73.  
  74. ───────────────────────────────────────────────────────────────────────────
  75.